/*
 * User: rant
 * Date: Aug 6, 2007
 *
 *
 */
package laMalinche.propertyChangeAdapters.model;

import laMalinche.testingPlayGround.testModel.ChangeListener;
import org.jetbrains.annotations.NotNull;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeEvent;

/**
 *
 */
public class ChangeListenerTOPCHangeListener  implements PropertyChangeListener {

	private final ChangeListener vOchangeListener;

	public ChangeListener getVOchangeListener() {
		return vOchangeListener;
	}

	public ChangeListenerTOPCHangeListener(ChangeListener propertyChangeListener) {
        vOchangeListener = propertyChangeListener;
	}

	public void propertyChange(@NotNull PropertyChangeEvent event) {
		vOchangeListener.entityChange(new PropertyChangeEventToEntityChange(event));
	}


	@Override
	public boolean equals(Object o){
		if (o instanceof ChangeListenerTOPCHangeListener){
			return ((ChangeListenerTOPCHangeListener) o).getVOchangeListener().equals(getVOchangeListener());
		}
		return false;
	}


}